package hk.ust.android_competition.store;

import java.io.IOException;
import java.util.ArrayList;

import hk.ust.android_competition.data_reload_tools.HttpTextFileGetter;

/**
 * Created by Silver on 3/1/15.
 */
public class CostumeCategory {
    private final int NO_OF_COSTUME = 2;
    private ArrayList<Boolean> costumeAvailable;

    public void setCostumeAvailable(Costume c) {
        costumeAvailable.set(c.getId(), true);
    }

    public Boolean[] getCostumeAvailable() {
        return costumeAvailable.toArray(new Boolean[costumeAvailable.size()]);
    }

    public CostumeCategory() {
        costumeAvailable = new ArrayList<>();
        for (int i = 0; i < NO_OF_COSTUME; i++) {
            costumeAvailable.add(false);
        }
    }

    public static void updateCategoryList() {
//        HttpTextFileGetter textGetter = new HttpTextFileGetter("http://hkust-android-contest.googlecode.com/svn/trunk/CostumeCategory.txt");
//        String[] typesOfCostume = textGetter.get().split(";");
//        for (int i = 0; i < typesOfCostume.length; i++) {
//            String[] costumeData = typesOfCostume[i].split(",");
//            costumeList.add(new Costume(costumeData[0], Integer.parseInt(costumeData[1])));
//        }
    }
}
